<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #cvs {
            /* 
                默认宽高 ：想要更改，要行内式设置
                width: 300px;
                height: 150px;
            */
            border: 1px solid #f00;
        }
    </style>
</head>

<body>
    <canvas id="cvs" width="1000" height="500"></canvas>
</body>
<script>
    // 1.获取canvas的元素    获取任何标签
    const cvsDom = document.querySelector('#cvs')

    // 2.生成canvas绘制元素
    const context = cvsDom.getContext('2d');

    //      填充
    context.lineWidth = 3;
    context.strokeStyle = '#f00';
    context.fillStyle = 'pink';

    context.beginPath();

    context.arc(150, 150, 100, Math.PI / 180 * 0, Math.PI / 180 * 360, false);
    context.stroke();


    context.beginPath();
    context.arc(110, 125, 15, Math.PI / 180 * 0, Math.PI / 180 * 360, false);
    context.stroke();



    context.beginPath();
    context.arc(180, 125, 15, Math.PI / 180 * 0, Math.PI / 180 * 360, false);
    context.stroke();


    context.beginPath();
    context.arc(150, 175, 30, Math.PI / 180 * 0, Math.PI / 180 * 180, false);
    context.stroke();


</script>

</html>